<template>
  <div class="goodsDesc">
      <!-- 标题部分 -->
      <h2> {{ goodsDescList.title }}</h2>
      <hr>
      <!-- 内容部分 -->
      <p v-html="goodsDescList.content" class="content"></p>
  </div>
</template>

<script>
export default {
  data(){
    return {
      id: this.$route.params.id,
      goodsDescList:{}
    }
  },
  created(){
    this.getGoodsDesc();
  },
  methods:{
    getGoodsDesc(){
      console.log(this.id)
      this.$http.get('api/goods/getdesc/' + this.id).then(result => {
        if(result.body.status === 0) {
          this.goodsDescList = result.body.message[0];
        }
      })
    }
  },
  // props:['id']
}
</script>

<style lang="less" scoped>
  .goodsDesc {
    padding: 4px;
    h2 {
      font-size: 14px;
      text-align: center;
      color: skyblue;
    }
   /deep/ .content {
      img {
        width: 100%;
      }
    }   
  }
</style>


